function UserScore() {
	this.Data = new Array();
	this.State = null;
}

UserScore.prototype.getLen = function(){
	return this.Data.length;
}

UserScore.prototype.send2Web = function(){
	if(this.Data.length == 0){
		alert(UserTable.Msg.User_Null);
		return;
	}
	try{
		SendMsg2Web('WriteScore2Web', this, null);
	}catch(err){
		alert(err);
	}
}

// 从用户输入的成绩单数据(UserData)中获取ScoreData，其每一行数据按照[id, name, score]进行排列
UserScore.prototype.pushTxt = function(UserData, FileType){
	UserData = UserData.trim();
	if(UserData == '')
		return;
	
	UserData = UserData.split('\n');
	
	var result = new UserTable().getIdx(UserData);
	p_r0    = result[0];
	p_id    = result[1][0];
	p_name  = result[1][1];
	p_score = result[1][2];
	
	var i, j;
	
	// 获取所有的“用户端”的成绩数据
	var id, name, score, ColNum = 0;
	for(i = p_r0; i < UserData.length; i++) {
		id = ''; name = ''; score = '';
		UserData[i] = UserData[i].trim();
		if(UserData[i] == '')
			continue;
		
		ScoreRow = UserData[i].split(ScoreSegs);
		
		if(ColNum == 0)
			ColNum = ScoreRow.length;
		if(ScoreRow.length < ColNum)
			continue;
		
		if(p_id > -1)
			id = ScoreRow[p_id].trim();
		
		if(p_name > -1)
			name = ScoreRow[p_name].trim();
		
		if(p_score < ScoreRow.length)
			score = ScoreRow[p_score].trim();
		
		if((score == '') || (id == '' && name == ''))
			continue;
		
		this.Data.push([id, name, score]);
	}
}

UserScore.prototype.pushXls = function(data) {
	try {
		var workbook = XLSX.read(data, {type: 'binary'});
	} catch (e) {
		alert('Excel文件类型不正确！');
		return;
	}
	
	data = [];
	
	// 遍历所有表单
	for (var sheet in workbook.Sheets) {
		if (workbook.Sheets.hasOwnProperty(sheet)) {
			fromTo = workbook.Sheets[sheet]['!ref'];
			//console.log(sheet);
			if(typeof(fromTo) == 'undefined')
				continue;
			
			var csv = XLSX.utils.make_csv(workbook.Sheets[sheet]);
			//data = data.concat(XLSX.utils.sheet_to_json(workbook.Sheets[sheet]));
			
			//console.log(csv);
			try{
				this.pushTxt(csv);
			}catch(err){
				//alert(err);
				continue;
			}
		}
	}
}
